<!DOCTYPE html>
<html class="h100%">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>选择公司</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="stylesheet" href="/asset/css/index.css?v=80917">
    <link rel="Shortcut Icon" href="cachet.ico">
    <script src="/asset/js/jquery.min.js"></script>
    <style>
        .new_company{background:#f2f2f2}
        .company_box{width: 40%;background: #fff;border-radius: 10px;padding: 30px;text-align: center;margin: 80px auto;}
        .company_box .title{font-size:20px;color: #333;margin-bottom: 30px;}
        .company_list li{width:80%;border: 1px solid #f2f2f2;border-radius: 5px;margin: auto;margin-bottom:30px;}
        .compony_name{font-size:32px;color: #333;padding: 10px;}
    </style>
</head>
<body class="layui-layout-body new_company">

<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo"><img src="/asset/images/logon.png" alt=""></div>
    </div>
    <div class="company_box">
        <p class="title">选择已有企业</p>

        <ul class="company_list">
           <#list companys as item>
            <li>
                <div class="compony_name"><a href="javascript:void(0);" class="selected" data-id="${item.companyId}">${item.companyName}</a></div>
            </li>
           </#list>
        </ul>
    </div>
</div>

<script src="/asset/layui/layui.js"></script>
<script>


layui.use(['element','form'], function(){
    var element = layui.element;
    var form = layui.form;
    var layer = layui.layer;
    
    $(".selected").click(function(){
    	var id = $(this).attr("data-id");
    	$.ajax({
  			type:"get", 
  			url:"/company/selected.htm?companyId="+id,
  			success:function(result) {
	      		console.log(result)
	      		if(result.code=='1'){
	      			location.href="/index.htm"
	      		}
	      		
	      		if(result.code=='-001'){
	      			location.href="/login.htm"
	      		}
	      		
	      		if(result.code=='-002'){
	      			layer.msg("账户已经冻结");
	      		}
	      
	    	} 
	    });
    
    })
          	
});


    
</script>





</body>
</html>